﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;

public partial class _Default_test : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        //string phone = "18521947887";//朝阳渠道_李秀梅  戴晴
        string phone = "18040535979";    //濮阳渠道_王克丰  李柏磊
        //string phone = "13764885030"; //平凉渠道_张孝   李婷婷
        //string phone =  "18597845749"; //东营渠道_张晓楠   郑昱晨

        string sql = "select loginid,username,phone,role from sys_users where phone = '" + phone + "' and ltrim(rtrim(isactive))= 'Y'";
        DataTable dtqx = DBHelper.ExecuteDataTable(sql);
        if (dtqx.Rows.Count > 0)            
        {
            //string sqlye = "exec [zdy_查询经销商余额] '{0}'";
            //sqlye = string.Format(sqlye, dtqx.Rows[0]["loginid"].ToString());
            //DataTable dtye = DBHelper.ExecuteDataTable(sqlye);
            //if (dtye.Rows.Count > 0)
            //{
            //    if (Utility.ToDecimal(dtye.Rows[0]["FEECANTAKE"].ToString()) > 0)
            //    {
            if (dtqx.Rows[0]["role"].ToString() == "11")
            {

            }
            else
            {
                Response.Redirect("views\\Mobile\\main.html?mobile=" + HttpUtility.UrlEncode(dtqx.Rows[0]["phone"].ToString()) + "&customerCode=" + HttpUtility.UrlEncode(dtqx.Rows[0]["loginid"].ToString()) + ""); 
            }


            //    }
            //    else
            //    {
            //        Response.Write("<script>alert('当前可提货金额不足，无法发布调拨单！')</script>");
            //    }
            //}
            //else
            //{
            //    Response.Write("<script>alert('未查到该经销商余额，请联系管理员！')</script>");
            //}
        }
        else
        {
            Response.Write("<script>alert('不在用户列表中，请联系管理员！')</script>");
        }
        //Response.Write("<script language='javascript'>window.location='bj_examine.html?username=" + HttpUtility.UrlEncode(detail.email) + "'</script>"); 
    }

}

